//
//  constant.h
//  TORO
//  Created by 丁益 on 15/6/14.
//  Copyright (c) 2015年 丁益. All rights reserved.
//

#ifndef _____constant_h
#define _____constant_h

#ifdef DEBUG // 调试状态, 打开LOG功能
#define DYLog(...) NSLog(__VA_ARGS__)
#else // 发布状态, 关闭LOG功能
#define DYLog(...)
#endif

/******************************** 颜色设置 **********************************/
// 颜色
#define DYColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define DYColorRGBA(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]
// 随机色
#define DYRandomColor DYColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define LoginBgColor [UIColor colorWithRed:249/255.0 green:249/255.0 blue:246/255.0 alpha:1]
#define SettingBgColor [UIColor colorWithWhite:0.90 alpha:1]

#define NetErrorMsg CLLocalizedString(@"NetError", nil)

//主题色
#define ThemeColor DYColor(35, 154, 217)

/******************************** 屏幕尺寸**********************************/
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
#define iPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)

#define sWidth [UIScreen mainScreen].bounds.size.width
#define sHeight [UIScreen mainScreen].bounds.size.height

#define MemberListNum (iPhone5 ? 9 : 7)
#define MemberListRowHeight 40.0f

#define Screen3_5 ([UIScreen mainScreen].bounds.size.height == 480.0)
#define Screen4_0 ([UIScreen mainScreen].bounds.size.height == 568.0)
#define Screen4_7 ([UIScreen mainScreen].bounds.size.height == 667.0)
#define Screen5_5 ([UIScreen mainScreen].bounds.size.height == 736.0)


//屏幕尺寸
#define getScreenSize [UIScreen mainScreen].bounds.size

/******************************** 系统判断 **********************************/
// 是否为iOS7
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
// 是否为iOS9
#define iOS9 ([[UIDevice currentDevice].systemVersion doubleValue] >= 9.0)

// 导航栏标题的字体
#define DYNavigationTitleFont [UIFont boldSystemFontOfSize:18]


#define constantIconWidth  40
#define SysVerValue [[[UIDevice currentDevice] systemVersion] floatValue]


//本地化
#define CLLocalizedString(key,comment)\
 [NSString CLNSLocalizedString:(key)]

/******************** CABaseAnimation  path动画类型 **********************/
#define AnimationPathType_Opacity                       @"opacity"    //闪烁的动画
#define AnimationPathType_Transform                     @"transform"  //旋转动画
#define AnimationPathType_TransformTranslation          @"transform.translation"   //点移动动画
#define AnimationPathType_TransformTranslationX         @"transform.translation.x" //横向移动
#define AnimationPathType_TransformTranslationY         @"transform.translation.y" //纵向移动
#define AnimationPathType_TransformScale                @"transform.scale"         //缩放
#define AnimationPathType_Position                      @"position"   //路径动画



#endif
